libxl: ARM build: fix type of libxl__srm_callout_callback_restore_results
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 4 Apr 2016 10:41:19 +0000 (11:41 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 4 Apr 2016 10:50:17 +0000 (11:50 +0100)
COLO introduced a few callbacks. The original implementation used
unsigned long for a type which in fact should be xen_pfn_t. That broke
libxl compilation on ARM, because xen_pfn_t is not a synonym for
unsigned long on ARM platform.

Fixing this requires modifying the perl script: specifically now we
need to include xenctrl.h before _libxl_save_msgs_*.h, rather than
afterwards, so that we can use xen_pfn_t there.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_create.c
tools/libxl/libxl_save_msgs_gen.pl

index 6882ff8ef7b5e5ac298f84da5cc0d00b559f94b2..4b02de9f093436913ae61cf70ea20f75ff0b7adf 100644 (file)
@@ -1109,8 +1109,8 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     domcreate_stream_done(egc, &dcs->srs, rc);
 }
 
-void libxl__srm_callout_callback_restore_results(unsigned long store_mfn,
-          unsigned long console_mfn, void *user)
+void libxl__srm_callout_callback_restore_results(xen_pfn_t store_mfn,
+          xen_pfn_t console_mfn, void *user)
 {
     libxl__save_helper_state *shs = user;
     libxl__domain_create_state *dcs = shs->caller_state;
index c2243f242c5ea8e17940d099882c1192475d4e36..3ae7373afca5d1fab85fa89f3394a6d629e22f3d 100755 (executable)
@@ -29,8 +29,8 @@ our @msgs = (
     [  6, 'srcxA',  "wait_checkpoint", [] ],
     [  7, 'scxA',   "switch_qemu_logdirty",  [qw(int domid
                                               unsigned enable)] ],
-    [  8, 'rcx',    "restore_results",       ['unsigned long', 'store_gfn',
-                                              'unsigned long', 'console_gfn'] ],
+    [  8, 'rcx',    "restore_results",       ['xen_pfn_t', 'store_gfn',
+                                              'xen_pfn_t', 'console_gfn'] ],
     [  9, 'srW',    "complete",              [qw(int retval
                                                  int errnoval)] ],
 );
@@ -70,9 +70,9 @@ END_BOTH
 
 END_CALLOUT
 
-#include "_libxl_save_msgs_${ah}.h"
 #include <xenctrl.h>
 #include <xenguest.h>
+#include "_libxl_save_msgs_${ah}.h"
 
 END_HELPER
 }
@@ -141,7 +141,7 @@ static void bytes_put(unsigned char *const buf, int *len,
 
 END
 
-foreach my $simpletype (qw(int uint16_t uint32_t unsigned), 'unsigned long') {
+foreach my $simpletype (qw(int uint16_t uint32_t unsigned), 'unsigned long', 'xen_pfn_t') {
     my $typeid = typeid($simpletype);
     $out_body{'callout'} .= <<END;
 static int ${typeid}_get(const unsigned char **msg,